package com.netstar.jsonparser;

import java.io.IOException;

import org.json.JSONException;
import org.json.JSONObject;

public abstract class AbstractSingleObjParser extends AbstractParser {

	public AbstractSingleObjParser(String data) {
		super(data);
	}

	@Override
	public final Object parse() throws IOException, JSONException {
		final String source = dataSource;
		if (null == source || source.length() <= 0) {
			return null;
		}
		JSONObject jo = new JSONObject(source);
		return parseObject(jo.getJSONObject(RESULT));
	}

}
